/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tdtest.controls.factory;

import javafx.scene.Node;
import tdtest.controls.ControlFactory;
import tdtest.controls.ControlGroup;
import tdtest.data.DataObject;
import tdtest.data.TDGroup;

/**
 *
 * @author sutter
 */
public class GroupControlFactory<T extends DataObject> implements ControlFactory<TDGroup<T>> {
	
	private ControlFactory<T> groupEntryFactory;
	
	public GroupControlFactory(ControlFactory<T> groupEntryFactory) {
		this.groupEntryFactory = groupEntryFactory;
	}
	
	@Override
	public Node createControl(TDGroup<T> group) {
		ControlGroup<T> controlGroup = new ControlGroup<>(group,groupEntryFactory);
		return controlGroup;
	}
	
	@Override
	public TDGroup<T> createObject() {
		return new TDGroup<T>();
	}
}
